<script setup lang="ts">
interface BannerListType {
  picUrl: string;
}
let bannerList = ref<BannerListType[]>([
  { picUrl: "/images/solution/banner-retail1.png" },
]);
onMounted(() => {
  getBanner();
});
const getBanner = async () => {
  const res = await useApi().app.getBanner({
    bannerCategory: "SOLUTION_RETAIL",
  });
  if (res.data.length) {
    bannerList.value = res.data;
  }
};
const tabActive = ref(1);
const tabList = ref([
  { label: "客流分析" },
  { label: "自助结算" },
  { label: "销量预测" },
  { label: "耗损预警" },
  { label: "互动营销" },
]);
const handleClick = (key: number) => {
  tabActive.value = key + 1;
};
const tabActive2: any = ref(1);
const tabList2 = ref([
  { label: "交易通道稳定" },
  { label: "开放的合作平台" },
  { label: "线上线下一体化" },
]);
const handleClick2 = (key: number) => {
  tabActive2.value = key + 1;
};
</script>

<template>
  <div class="pages">
    <Swiper
      :height="480"
      :pagination="{
        clickable: true,
        clickableClass: 'web-pagination',
      }"
      :modules="[SwiperPagination]"
    >
      <SwiperSlide
        class="banner-item"
        v-for="(item, index) in bannerList"
        :key="index"
        :style="{ backgroundImage: `url(${item.picUrl})` }"
      >
        <div class="content">
          <div class="txt-shadow">
            <h1 class="title" data-aos="fade-up" data-aos-duration="1000">
              智慧零售支付
            </h1>
            <p
              class="desc"
              data-aos="fade-up"
              data-aos-duration="1000"
              data-aos-delay="500"
            >
              零售行业支付解决方案
            </p>
          </div>
        </div>
      </SwiperSlide>
    </Swiper>
    <div class="ability">
      <div class="content">
        <h1 class="ability-title">全链路零售营销策略</h1>
        <div class="ability-list">
          <div class="ability-left">
            <div class="tab">
              <div
                @mouseenter="handleClick(key)"
                class="tab-item"
                :class="{ active: tabActive === key + 1 }"
                v-for="(item, key) in tabList"
                :key="key"
              >
                {{ item.label }}
              </div>
            </div>
            <div class="tab-content" v-if="tabActive === 1">
              <img
                class="retail-left"
                src="/images/solution/retail-left1.png"
                alt="客流分析"
              />
              <div class="retail-right">
                <h1>客流分析</h1>
                <p>
                  实时监测客流，分析客群属性、行为轨迹、兴趣偏好，形成完整的消费者画像。精准分析客群，进行差异化导购，优化货品陈列、库存配置
                </p>
                <NuxtLink to="/register">
                  <div class="r-btn">快速上手接入</div>
                </NuxtLink>
              </div>
            </div>
            <div class="tab-content" v-if="tabActive === 2">
              <img
                class="retail-left"
                src="/images/solution/retail-left2.png"
                alt="自助结算"
              />
              <div class="retail-right">
                <h1>自助结算</h1>
                <p>
                  针对标准化商品、菜品，自动识别并计数，代替扫码枪、收银员人工计算，减少工作量，降低人力成本；同时可降低人工计算出错的风险，减少损失
                </p>
                <NuxtLink to="/register">
                  <div class="r-btn">快速上手接入</div>
                </NuxtLink>
              </div>
            </div>
            <div class="tab-content" v-if="tabActive === 3">
              <img
                class="retail-left"
                src="/images/solution/retail-left3.png"
                alt="销量预测"
              />
              <div class="retail-right">
                <h1>销量预测</h1>
                <p>
                  建立深度学习模型对特定商品的销量进行提前预测，能够帮助商家进行更好的库存管理，从而提升进货效率，降低特殊商品报损比例
                </p>
                <NuxtLink to="/register">
                  <div class="r-btn">快速上手接入</div>
                </NuxtLink>
              </div>
            </div>
            <div class="tab-content" v-if="tabActive === 4">
              <img
                class="retail-left"
                src="/images/solution/retail-left4.png"
                alt="耗损预警"
              />
              <div class="retail-right">
                <h1>耗损预警</h1>
                <p>
                  通过精准的监控数据分析，为超市提供商品损失数据分析，辅助进行商品管理
                </p>
                <NuxtLink to="/register">
                  <div class="r-btn">快速上手接入</div>
                </NuxtLink>
              </div>
            </div>
            <div class="tab-content" v-if="tabActive === 5">
              <img
                class="retail-left"
                src="/images/solution/retail-left5.png"
                alt="互动营销"
              />
              <div class="retail-right">
                <h1>互动营销</h1>
                <p>
                  根据顾客属性、偏好、大数据实时热点及用户痛点，推荐相关产品和内容，进行精准推销
                </p>
                <NuxtLink to="/register">
                  <div class="r-btn">快速上手接入</div>
                </NuxtLink>
              </div>
            </div>
          </div>

          <div class="drink-item" v-for="(item, key2) in tabList">
            <img
              v-if="key2 + 1 === tabActive"
              class="drink-icon"
              :class="{ 'animate__animated animate__fadeInRight': tabActive }"
              :src="'/images/solution/retail-right' + (key2 + 1) + '.png'"
              alt="全链路零售营销策略"
            />
          </div>
        </div>
      </div>
    </div>
    <div class="advantage">
      <div class="content">
        <h1 class="advantage-title">智慧支付，助力智慧零售</h1>
        <div class="tab">
          <div
            @mouseenter="handleClick2(key)"
            class="tab-item"
            :class="{ active: tabActive2 === key + 1 }"
            v-for="(item, key) in tabList2"
            :key="key"
          >
            {{ item.label }}
          </div>
        </div>
        <div class="tab-content" v-if="tabActive2 === 1">
          <div class="t-c-l">
            <h1>交易通道稳定</h1>
            <p>提供稳定的交易网络，7*24小时保障业务持续开展。</p>
            <NuxtLink to="/register">
              <div class="r-btn">快速上手接入</div>
            </NuxtLink>
          </div>
          <img
            class="t-c-img animate__animated animate__fadeInUp"
            src="/images/solution/retail-img1.png"
            alt="交易通道稳定"
          />
        </div>
        <div class="tab-content" v-if="tabActive2 === 2">
          <div class="t-c-l">
            <h1>开放的合作平台</h1>
            <p>
              为合作伙伴提供多种合作模式，支持插件形式嵌入外部应用，也支持平台整体解决方案输出。
            </p>
            <NuxtLink to="/register">
              <div class="r-btn">快速上手接入</div>
            </NuxtLink>
          </div>
          <img
            class="t-c-img animate__animated animate__fadeInUp"
            src="/images/solution/retail-img2.png"
            alt="开放的合作平台"
          />
        </div>
        <div class="tab-content" v-if="tabActive2 === 3">
          <div class="t-c-l">
            <h1>线上线下一体化</h1>
            <p>
              线上线下业务实时交互，一键便捷操作，打造智慧收银，方式丰富，会员信息同步
            </p>
            <NuxtLink to="/register">
              <div class="r-btn">快速上手接入</div>
            </NuxtLink>
          </div>
          <img
            class="t-c-img animate__animated animate__fadeInUp"
            src="/images/solution/retail-img3.png"
            alt="交易通道稳定"
          />
        </div>
      </div>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.pages {
  .go-btn {
    width: 308px;
    height: 48px;
    background: #e22000;
    border-radius: 4px 4px 4px 4px;
    font-weight: 400;
    font-size: 15px;
    color: #ffffff;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 34px auto;
    transition: all 0.3s ease-in-out;
    img {
      width: 19px;
      height: 9px;
      margin-left: 8px;
      transition: transform 0.3s ease-in-out;
    }
    &:hover {
      box-shadow: 0 0 15px rgba(226, 32, 0, 0.5);
      img {
        transform: translateX(10px);
      }
    }
  }
  .swiper {
    max-width: 1920px;
  }
  .banner-item {
    min-height: 480px;
    background-position: left;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    .content {
      padding-left: 50px;
      box-sizing: border-box;
      text-align: right;
      .txt-shadow {
        display: inline-block;
        margin-right: 88px;
        margin-top: 134px;
        text-align: center;
      }
      .title {
        font-weight: 700;
        font-size: 56px;
        color: #070a14;
        letter-spacing: 1px;
      }
      .desc {
        margin-top: 12px;
        font-weight: 400;
        font-size: 21px;
        color: #202949;
        margin-top: 20px;
      }
    }
  }
  .ability {
    padding-top: 108px;
    padding-bottom: 154px;
    box-sizing: border-box;
    .ability-title {
      font-weight: 700;
      font-size: 42px;
      text-align: center;
      color: #070a14;
    }
    .ability-list {
      margin-top: 94px;
      padding: 0 21px;
      box-sizing: border-box;
      overflow: hidden;
      &::after {
        content: "";
        display: block;
        clear: both;
      }
      .ability-left {
        padding-top: 44px;
        box-sizing: border-box;
        float: left;
        .tab {
          .tab-item {
            cursor: pointer;
            background: #f6f7fa;
            border-bottom: 2px solid #c6ccdb;
            width: 101px;
            font-weight: 600;
            font-size: 18px;
            color: #959eae;
            text-align: center;
            float: left;
            padding-top: 20px;
            padding-bottom: 16px;
            position: relative;
            transition: all 0.1s ease;
            &.active {
              border-top: 6px solid #e12010;
              background: #ffffff;
              font-weight: 600;
              font-size: 18px;
              padding-top: 14px;
              color: #202949;
              border-bottom-color: #ffffff;
              &::after {
                display: none;
              }
            }
            &:last-child {
              &::after {
                display: none;
              }
            }
            &::after {
              content: "";
              display: block;
              height: 30px;
              width: 1px;
              background: #c6ccdb;
              position: absolute;
              right: 0;
              top: 50%;
              margin-top: -15px;
            }
          }
          &::after {
            content: "";
            display: block;
            clear: both;
          }
        }
        .tab-content {
          margin-top: 54px;
          .retail-left {
            width: 67px;
            height: 367px;
            float: left;
          }
          .retail-right {
            float: left;
            margin-left: 21px;
            h1 {
              font-weight: 600;
              font-size: 30px;
              color: #070a14;
              position: relative;
              margin-top: 32px;
              &::after {
                content: "";
                display: block;
                position: absolute;
                left: 0;
                bottom: -29px;
                width: 30px;
                height: 2px;
                background: #e12010;
              }
            }
            p {
              margin-top: 55px;
              width: 470px;
              display: inline-block;
              font-weight: 400;
              font-size: 17px;
              color: #7a7b7f;
              line-height: 27px;
            }
            .r-btn {
              margin-top: 62px;
              width: 300px;
              height: 76px;
              background: #ffffff;
              border: 2px solid #242424;
              font-weight: 600;
              font-size: 19px;
              color: #242424;
              letter-spacing: 1px;
              text-align: center;
              display: flex;
              align-items: center;
              justify-content: center;
              position: relative;
              transition: all 0.3s ease-in-out;
              cursor: pointer;
              a {
                font-weight: 600;
                font-size: 20px;
                color: #242424;
              }
              &:hover {
                background-color: rgba(0, 0, 0, 0.05);
                &::after {
                  transform: translateX(10px);
                }
              }
              &::after {
                content: "";
                display: block;
                transition: transform 0.3s ease-in-out;
                position: absolute;
                right: -40px;
                width: 79px;
                height: 15px;
                background-image: url("/images/layouts/more-btn-arrow2.png");
                background-repeat: no-repeat;
                background-size: 100% 100%;
                z-index: 1;
              }
            }
          }
          &::after {
            content: "";
            display: block;
            clear: both;
          }
        }
      }
      .drink-icon {
        float: right;
        width: 521px;
        height: 521px;
        position: relative;
        z-index: 2;
      }
    }
  }
  .advantage {
    padding-top: 120px;
    padding-bottom: 139px;
    box-sizing: border-box;
    background-color: #ebedf3;
    overflow: hidden;
    .advantage-title {
      font-weight: 700;
      font-size: 42px;
      color: #070a14;
      text-align: center;
    }
    .tab {
      border-bottom: 2px solid rgba(198, 204, 219, 0.5);
      margin-top: 82px;
      .tab-item {
        cursor: pointer;
        width: 33%;
        font-weight: 400;
        font-size: 24px;
        color: #959eae;
        text-align: center;
        float: left;
        padding-top: 20px;
        padding-bottom: 16px;
        position: relative;
        transition: all 0.3s ease;
        &.active {
          font-weight: 600;
          color: #202949;
          padding-top: 14px;
          &::before {
            content: "";
            display: block;
            width: 170px;
            height: 6px;
            background: #e12010;
            position: absolute;
            margin-left: -85px;
            left: 50%;
            top: 0;
          }
        }
        &:last-child {
          &::after {
            display: none;
          }
        }
        &::after {
          content: "";
          display: block;
          height: 30px;
          width: 1px;
          background: #c6ccdb;
          position: absolute;
          right: 0;
          top: 50%;
          margin-top: -15px;
        }
      }
      &::after {
        content: "";
        display: block;
        clear: both;
      }
    }
    .tab-content {
      margin-top: 65px;
      height: 572px;
      position: relative;
      overflow: hidden;
      .t-c-l {
        width: 988px;
        height: 572px;
        background-color: #fff;
        padding-left: 48px;
        box-sizing: border-box;
        overflow: hidden;
        h1 {
          font-weight: 600;
          font-size: 32px;
          color: #070a14;
          margin-top: 66px;
          position: relative;
          &::after {
            content: "";
            display: block;
            position: absolute;
            left: 0;
            bottom: -29px;
            width: 30px;
            height: 2px;
            background: #e12010;
          }
        }
        p {
          width: 528px;
          display: inline-block;
          font-weight: 400;
          font-size: 18px;
          color: #7a7b7f;
          margin-top: 55px;
        }
        .r-btn {
          margin-top: 62px;
          width: 300px;
          height: 76px;
          background: #ffffff;
          border: 2px solid #242424;
          font-weight: 600;
          font-size: 19px;
          color: #242424;
          letter-spacing: 1px;
          text-align: center;
          display: flex;
          align-items: center;
          justify-content: center;
          position: relative;
          transition: all 0.3s ease-in-out;
          &:hover {
            background-color: rgba(0, 0, 0, 0.05);
            &::after {
              transform: translateX(10px);
            }
          }
          &::after {
            content: "";
            display: block;
            transition: transform 0.3s ease-in-out;
            position: absolute;
            right: -40px;
            width: 79px;
            height: 15px;
            background-image: url("/images/layouts/more-btn-arrow2.png");
            background-repeat: no-repeat;
            background-size: 100% 100%;
            z-index: 1;
          }
        }
      }
      .t-c-img {
        width: 530px;
        height: 530px;
        position: absolute;
        right: 0;
        top: 21px;
      }
    }
  }
  .footer {
    height: 480px;
    margin-bottom: 150px;
    text-align: center;
    background-size: cover;
    background-position: left;
    background-repeat: no-repeat;
    background-image: url("/images/solution/catering-footer.png");
    h1 {
      display: inline-block;
      margin-top: 150px;
      font-weight: 500;
      font-size: 18px;
      color: #202949;
      width: 858px;
      line-height: 26px;
    }
  }
}
</style>
